package
{
	import de.polygonal.math.PM_PRNG;

	public class Global
	{
		public static var prng:PM_PRNG;
		
		public function Global()
		{
		}
		
		//inclusive
		public static function randBetween(min:int, max:int):int{
			return Math.round(Global.prng.nextDoubleRange(min, max));
		}
		
		public static function expRandBetween(min:int, max:int):int{
			var delta:int = Math.abs(max - min);
			var log:Number = min + Math.floor(Math.min(delta , Math.log(1 - Global.prng.nextDouble()) / -Math.log(2)));
			return log;
		}
	}
}